package com.chinaunicom.order.domain.model.valobj;

import lombok.Getter;

/**
 * @author guomenghuai
 * @date 2024/1/10
 * @Description
 */
@Getter
public enum PayStatus {

    UNPAID(10, "未支付"),
    PAID(20, "已支付");

    private final Integer code;

    private final String msg;

    PayStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static PayStatus getByCode(Integer code) {
        for (PayStatus element : PayStatus.values()) {
            if (code.equals(element.getCode())) {
                return element;
            }
        }
        return null;
    }
}
